package product

import (
	"sync"
)

// CertPicInfo 结构体
type CertPicInfo struct {
	// 认证图片的url地址
	PicUrl string `json:"pic_url,omitempty" xml:"pic_url,omitempty"`
	// 认证类型的数值id
	CertType int64 `json:"cert_type,omitempty" xml:"cert_type,omitempty"`
}

var poolCertPicInfo = sync.Pool{
	New: func() any {
		return new(CertPicInfo)
	},
}

// GetCertPicInfo() 从对象池中获取CertPicInfo
func GetCertPicInfo() *CertPicInfo {
	return poolCertPicInfo.Get().(*CertPicInfo)
}

// ReleaseCertPicInfo 释放CertPicInfo
func ReleaseCertPicInfo(v *CertPicInfo) {
	v.PicUrl = ""
	v.CertType = 0
	poolCertPicInfo.Put(v)
}
